#encoding: utf-8
namespace :user do
  desc "user create"

  task create: :environment do
    users = User.all
    if users.blank?
      user = User.new(name: 'admin', password: '123456', password_confirmation: '123456')

      if user.save
        puts "user created successfully"
      else
        puts "user created failed"
      end
    else
      puts "user already exist"
    end
  end
end
